using System.ComponentModel;

namespace SumerCoreDevOps.Application.Dtos.Requests.SystemConfigs
{
    /// <summary>
    /// 更新配置请求
    /// </summary>
    public class UpdateConfigRequest
    {
        /// <summary>
        /// 配置值
        /// </summary>
        /// <example>9090</example>
        [Description("配置值")]
        public string ConfigValue { get; set; } = null!;

        /// <summary>
        /// 更新者
        /// </summary>
        /// <example>admin</example>
        [Description("更新者")]
        public string? UpdatedBy { get; set; }
    }

    /// <summary>
    /// 批量更新配置请求
    /// </summary>
    public class UpdateConfigsRequest
    {
        /// <summary>
        /// 配置字典（键为配置名，值为配置值）
        /// </summary>
        [Description("配置字典")]
        public Dictionary<string, string> Configs { get; set; } = new();

        /// <summary>
        /// 更新者
        /// </summary>
        /// <example>admin</example>
        [Description("更新者")]
        public string? UpdatedBy { get; set; }
    }

    /// <summary>
    /// 创建配置请求
    /// </summary>
    public class CreateConfigRequest
    {
        /// <summary>
        /// 配置键
        /// </summary>
        /// <example>CustomConfig.Key</example>
        [Description("配置键")]
        public string ConfigKey { get; set; } = null!;

        /// <summary>
        /// 配置值
        /// </summary>
        /// <example>value</example>
        [Description("配置值")]
        public string ConfigValue { get; set; } = null!;

        /// <summary>
        /// 配置类型
        /// </summary>
        /// <example>String</example>
        [Description("配置类型")]
        public string? ConfigType { get; set; } = "String";

        /// <summary>
        /// 配置类别
        /// </summary>
        /// <example>Custom</example>
        [Description("配置类别")]
        public string? Category { get; set; }

        /// <summary>
        /// 配置描述
        /// </summary>
        /// <example>自定义配置</example>
        [Description("配置描述")]
        public string? Description { get; set; }

        /// <summary>
        /// 是否需要重启
        /// </summary>
        /// <example>false</example>
        [Description("是否需要重启")]
        public bool RequiresRestart { get; set; } = false;

        /// <summary>
        /// 是否敏感信息
        /// </summary>
        /// <example>false</example>
        [Description("是否敏感信息")]
        public bool IsSensitive { get; set; } = false;

        /// <summary>
        /// 创建者
        /// </summary>
        /// <example>admin</example>
        [Description("创建者")]
        public string? CreatedBy { get; set; }
    }

    /// <summary>
    /// 更新网络配置请求
    /// </summary>
    public class UpdateNetworkConfigRequest
    {
        /// <summary>
        /// 控制API端口
        /// </summary>
        /// <example>5000</example>
        [Description("控制API端口")]
        public int? ControlApiPort { get; set; }

        /// <summary>
        /// TCP服务器端口
        /// </summary>
        /// <example>9090</example>
        [Description("TCP服务器端口")]
        public int? TcpServerPort { get; set; }

        /// <summary>
        /// 节点默认端口
        /// </summary>
        /// <example>9091</example>
        [Description("节点默认端口")]
        public int? NodeDefaultPort { get; set; }

        /// <summary>
        /// 更新者
        /// </summary>
        /// <example>admin</example>
        [Description("更新者")]
        public string? UpdatedBy { get; set; }
    }
}
